package com.javabi.sizeof.definition.quick;

import com.javabi.sizeof.ClassDefinition;

/**
 * A String Definition.
 * <p>
 * WARNING: This definition completely ignores the substring/split issue. It
 * assumes all {@link String}s are backed by a char[] of the same length as the
 * String itself. Strings created from the {@link String#substring()} methods or
 * {@link String#split()} methods will NOT have their memory accurately
 * calculated.
 */
public final class StringQuickDefinition extends ClassDefinition<String> {

	@Override
	public long sizeOf(String text) {
		return 24 + sizeOfShortArray(text.length());
	}

}
